/* Base styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-color: #1f2937;
    --spacing-unit: 2rem;
    --card-text-color: #333;
    --card-background-color: #ffffff;
}

/* Improved dark mode text colors for better contrast */
body.dark-mode {
    --primary-color: #1e40af;
    --secondary-color: #2563eb;
    --background-color: #1f2937;
    --card-background: #2d3748;
    --text-color: #f8fafc;
    --card-text-color: #ffffff;
    --card-background-color: #2d3748;
}

/* Project card text colors override for dark mode */
body.dark-mode .project-info h2 {
    color: #ffffff;
}

body.dark-mode .project-info p {
    color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: var(--spacing-unit);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Adjust header to be horizontally centered at the top */
header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: left;
    gap: 24px;
    padding: 20px 0; /* Add padding for spacing */
    height: auto; /* Remove fixed height */
    position: relative; /* Ensure it stays at the top */
}

main {
    margin-top: 40px; /* Add spacing between header and main content */
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.header-text h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: #4b5563;
}

body.dark-mode .header-text h2 {
    color: #e2e8f0;
}

header .logo {
    max-width: 100px;
    height: auto;
    margin: 0;
}

/* Grid layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-unit);
    max-width: 1400px;
    margin: 0 auto;
}

/* Project card styles */
.project-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--card-text-color);
    background-color: var(--card-background-color);
    padding: 16px;
    text-align: center;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    max-width: 100%;
    height: auto;
    border-bottom: 1px solid #ddd;
    margin-bottom: 16px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: var(--spacing-unit);
}

.project-info h2 {
    font-size: 1.5rem;
    margin: 0 0 8px;
    color: #333;
}

.project-info p {
    font-size: 1rem;
    color: #666;
    margin: 0 0 16px;
    min-height: 4.8em;
}

/* Button styles */
.launch-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007BFF;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.launch-btn:hover {
    background-color: #0056b3;
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #FF5733;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
}

.logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-unit: 1rem;
    }

    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }
}